package edu.hendrix.grambler.grammars;


/**
 * This class demonstrates how to add actions using the index of production IDs.
 * 
 * @author Rod
 *
 */
public class SimpleMathWithActions extends SimpleMath {
    public SimpleMathWithActions() {
        super();
        BinaryArithmeticAction sum = new BinaryArithmeticAction("sum", "op", "number");
        
        addAction (sum, getProductionId(0));
        addAction(new BinaryArithmeticAction.NumberAction(), getProductionId(1));
        addAction(BinaryArithmeticAction.ArithmeticOperation.ADDITION, getProductionId(3));
        addAction(BinaryArithmeticAction.ArithmeticOperation.SUBTRACTION, getProductionId(4));
        addAction(new BinaryArithmeticAction.NumberAction(), getProductionId(5));
    }
}

